package com.qianfeng.dao;

import com.qianfeng.model.Member;
import com.qianfeng.util.DBUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class MemberDao {

    //通过手机号查询用户
    public Member getOne(String phone) throws SQLException {
        QueryRunner queryRunner=new QueryRunner(DBUtil.getDataSource());
        Member member=
        queryRunner.query("Select * from member where phone=?",new BeanHandler<>(Member.class),phone);
        return member;
    }
}
